﻿package com.victory.properties
{
	import flash.events.StatusEvent;
	import mx.controls.Alert;
	
	/**
	 * ...
	 * @author ...
	 */
	public class Equipment
	{
		public var type:String;
		public var name:String;
		public var effects:Array = new Array();
		public var attributes:Array = new Array();
		
		public function Equipment(t:String, n:String, eff:XMLList, att:XMLList) {
			name = n;
			type = t;
			parseEffects(eff);
			parseAttributes(att);
		}
		
		public function parseEffects(eff:XMLList):void {
			// Need to create an effect object.
			// Then turn eff first child into effect
			// Then add effect to effects array
			// Then, in main program, add each items effects array to the effects array of the player.
			
		}
		
		public function parseAttributes(att:XMLList):void {
			//Alert.show(name + ": " + att.HP.toString());
			attributes["HP"] = att.HP;
			attributes["AP"] = att.AP;
			attributes["apRegen"] = att.APregen;
			attributes["Pdefense"] = att.physical;
			attributes["Edefense"] = att.elemental;
			attributes["Cdefense"] = att.corporeal;
			attributes["Sdefense"] = att.spiritual;
		}
	}
	
}